package com.yuan.base.framework.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;


/**
 * 用户基本信息
 */
public class UserInfo implements Parcelable {

	private String name;// 姓名
	private String idCardNo;// 身份证
	private String gender;// 性别
	private String spic;// 小头像
	private String mpic;// 中头像
	private String lpic;// 大头像
	private String phone1;// 手机号码，跟用户名一致
	private String phone2;// 备用联系方式
	private String mail;// 邮件地址
	private String wechat;// 微信号
	private boolean authorized;// 家长信息后台审核

	private List<TeachSchool> additionalInformation;
	private Integer[] classIds;
	private String[] classNames;
	private boolean master;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIdCardNo() {
		return idCardNo;
	}

	public void setIdCardNo(String idCardNo) {
		this.idCardNo = idCardNo;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getSpic() {
		return spic;
	}

	public void setSpic(String spic) {
		this.spic = spic;
	}

	public String getMpic() {
		return mpic;
	}

	public void setMpic(String mpic) {
		this.mpic = mpic;
	}

	public String getLpic() {
		return lpic;
	}

	public void setLpic(String lpic) {
		this.lpic = lpic;
	}

	public String getPhone1() {
		return phone1;
	}

	public void setPhone1(String phone1) {
		this.phone1 = phone1;
	}

	public String getPhone2() {
		return phone2;
	}

	public void setPhone2(String phone2) {
		this.phone2 = phone2;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getWechat() {
		return wechat;
	}

	public void setWechat(String wechat) {
		this.wechat = wechat;
	}

	public boolean isAuthorized() {
		return authorized;
	}

	public void setAuthorized(boolean authorized) {
		this.authorized = authorized;
	}

	public List<TeachSchool> getAdditionalInformation() {
		return additionalInformation;
	}

	public void setAdditionalInformation(List<TeachSchool> additionalInformation) {
		this.additionalInformation = additionalInformation;
	}

	public Integer[] getClassIds() {
		return classIds;
	}

	public void setClassIds(Integer[] classIds) {
		this.classIds = classIds;
	}

	public String[] getClassNames() {
		return classNames;
	}

	public void setClassNames(String[] classNames) {
		this.classNames = classNames;
	}

	public boolean isMaster() {
		return master;
	}

	public void setMaster(boolean master) {
		this.master = master;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(this.name);
		dest.writeString(this.idCardNo);
		dest.writeString(this.gender);
		dest.writeString(this.spic);
		dest.writeString(this.mpic);
		dest.writeString(this.lpic);
		dest.writeString(this.phone1);
		dest.writeString(this.phone2);
		dest.writeString(this.mail);
		dest.writeString(this.wechat);
		dest.writeByte(this.authorized ? (byte) 1 : (byte) 0);
		dest.writeList(this.additionalInformation);
		dest.writeArray(this.classIds);
		dest.writeStringArray(this.classNames);
		dest.writeByte(this.master ? (byte) 1 : (byte) 0);
	}

	public UserInfo() {
	}

	protected UserInfo(Parcel in) {
		this.name = in.readString();
		this.idCardNo = in.readString();
		this.gender = in.readString();
		this.spic = in.readString();
		this.mpic = in.readString();
		this.lpic = in.readString();
		this.phone1 = in.readString();
		this.phone2 = in.readString();
		this.mail = in.readString();
		this.wechat = in.readString();
		this.authorized = in.readByte() != 0;
		this.additionalInformation = new ArrayList<TeachSchool>();
		in.readList(this.additionalInformation, TeachSchool.class.getClassLoader());
		this.classIds = (Integer[]) in.readArray(Integer[].class.getClassLoader());
		this.classNames = in.createStringArray();
		this.master = in.readByte() != 0;
	}

	public static final Creator<UserInfo> CREATOR = new Creator<UserInfo>() {
		@Override
		public UserInfo createFromParcel(Parcel source) {
			return new UserInfo(source);
		}

		@Override
		public UserInfo[] newArray(int size) {
			return new UserInfo[size];
		}
	};
}
